package com.jxud.mapper;


import com.jxud.Pojo.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select * from users where username = #{username}")
    Users getByUsernameAndPassword(Users users);

    @Insert("INSERT INTO users (username, password, phone, wechat_nickname) VALUES (#{username},#{password},#{phone},#{wechatNickname});")
    void save(Users users);

//    @Select("select id,username from users ORDER BY id")
    List<Users> getUser(Users users);

    @Select("select id,status from users where id = #{id}")
    Users getUserById(Integer id);
}
